#pragma once

#include "Vector3.h"
#include "Quaternion.h"

#define MATRIX_TRANSLATION_X_INDEX	12
#define MATRIX_TRANSLATION_Y_INDEX	13
#define MATRIX_TRANSLATION_Z_INDEX	14

#define MATRIX_SCALE_X_INDEX		0
#define	MATRIX_SCALE_Y_INDEX		5
#define MATRIX_SCALE_Z_INDEX		10

#define MATRIX_RIGHT_X_INDEX		0
#define	MATRIX_RIGHT_Y_INDEX		4
#define MATRIX_RIGHT_Z_INDEX		8

#define MATRIX_UP_X_INDEX			1
#define	MATRIX_UP_Y_INDEX			5
#define MATRIX_UP_Z_INDEX			9

#define MATRIX_FORWARD_X_INDEX		2
#define	MATRIX_FORWARD_Y_INDEX		6
#define MATRIX_FORWARD_Z_INDEX		10

typedef float Matrix[16];

class MatrixHelper
{
private:
	MatrixHelper();
public:
	~MatrixHelper();
public:
	static void LoadIdentity(Matrix matrix);
	static void LoadRotation(const Quaternion& rotation);
public:
	static void MultiplyRotation(const Quaternion& rotation);
public:
	static void GetUp(const Matrix matrix, Vector3f& up);
	static void GetRight(const Matrix matrix, Vector3f& right);
	static void GetForward(const Matrix matrix, Vector3f& forward);
	static void GetScale(const Matrix matrix, Vector3f& scale);
	static void GetTranslation(const Matrix matrix, Vector3f& translation);
	static void GetRotation(const Matrix matrix, Quaternion& rotation);
public:
	static void SetUp(Matrix matrix, const Vector3f& up);
	static void SetLeft(Matrix matrix, const Vector3f& left);
	static void SetForward(Matrix matrix, const Vector3f& forward);
	static void SetScale(Matrix matrix, const Vector3f& scale);
	static void SetTranslation(Matrix matrix, const Vector3f& translation);
	static void SetRotation(Matrix matrix, const Quaternion& rotation);
};